package com.dragon.common.modules.uaa.domain.entity;

import com.dragon.common.spring.business.base.jpa.audit.AbstractCommonAuditEntity;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;

@Getter
@Setter
@Entity
@Table(name = "uaa_account_info")
public class UaaAccountInfoEntity extends AbstractCommonAuditEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

    @NotNull
    @Column(name = "account_code", nullable = false)
    private Long accountCode;

    @Size(max = 20)
    @Column(name = "real_name", length = 20)
    private String realName;

    @Size(max = 20)
    @Column(name = "first_name", length = 20)
    private String firstName;

    @Size(max = 20)
    @Column(name = "last_name", length = 20)
    private String lastName;

    @Size(max = 20)
    @Column(name = "nick_name", length = 20)
    private String nickName;

    @NotNull
    @ColumnDefault("0")
    @Column(name = "gender", nullable = false)
    private Boolean gender = false;

    @NotNull
    @ColumnDefault("0")
    @Column(name = "age", nullable = false)
    private Byte age;

    @Size(max = 20)
    @Column(name = "address", length = 20)
    private String address;

}